import DelButton from '../../components/delbutton';
import { IData } from '../api/class/lzqsearch.api';
import api from '../../atoms/api';
import Bianji from './bianji';
import Table from '../../components/table';
import IconButton from '../../components/iconbutton';

export default function Mylist({ data }: {
	data: IData[];
}) {
	return <>
		<Table
			idfieldname='class_id'
			render={(record) => {
				const { class_id, ...data } = record;
				const url = `/class/classes?id=${class_id}`;
				return <>
					<Bianji data={data} />

					<DelButton query={{
						id:
							class_id




					}} dlgtitle='确认删除' api={api['/api/class/shanchu']} />

					<a href={url}>
						<IconButton img='/icons/lzqchengyuan.png' label='成员' title='维护班级成员' />
					</a>
				</>;
			}}
			data={data}
		>
			<Table.Column<IData> title='年级' key='grade' dataIndex='grade' align='left' />
			<Table.Column<IData> title='专业' key='majorname' dataIndex='majorname' align='left' />
			<Table.Column<IData> title='班级名称' key='classname' dataIndex='classname' align='left' />
			<Table.Column<IData> title='班长姓名' key='monitorname' dataIndex='monitorname' align='left' />
			<Table.Column<IData> title='学委姓名' key='studycommitteename' dataIndex='studycommitteename' align='left' />
		</Table>
	</>;
}
